import request from '@/utils/request'

// 管理员  分页展示评论列表
export const reqCommentListByPage = (PageParams, name, statusSearch) => request({
  url: '/admin/commentListByPage',
  method: 'post',
  data: {
    page: PageParams.page,
    pageSize: PageParams.pageSize,
    name: name,
    status: statusSearch
  }
})
// 管理员 根据评论id查询评论
export const reqQueryComment = (id) => request({
  url: `/admin/queryComment/${id}`,
  method: 'get'
})

// 管理员 根据id禁用用户
export const disableUser = (PageParams) => request({
  url: `/admin/disableUser`,
  method: 'post',
  data: PageParams
})
// 管理员删除评论
export const reqRemoveComment = (id) => request({
  url: `/admin/removeComment/${id}`,
  method: 'get'
})

// 管理员用户列表
export const reqUserList = (User) => request({
  url: '/admin/userListByPage',
  method: 'post',
  data: User
})
// 删除管理员用户列表
export const deleteById = (param) => request({
  url: '/admin/deleteUserById',
  method: 'post',
  data: param
})

// 管理员新增用户
export const reqSaveUser = (user) => request({
  url: '/admin/saveUser',
  method: 'post',
  data: user
})
export const reqSendPhone = (user) => request({
  url: '/api/msm/sendPhoneCode',
  method: 'post',
  data: user
})
export const reqSendEmail = (user) => request({
  url: '/api/msm/sendEmailCode',
  method: 'post',
  data: user
})
// 管理员修改用户
export const reqUpdateUser = (user) => request({
  url: '/admin/updateUser',
  method: 'post',
  data: user
})

// 管理员用户列表
export const reqShopList = (PageParams) => request({
  url: '/admin/shopListByPage',
  method: 'post',
  data: PageParams
})
// 管理员新增用户
export const reqSaveShop = (shop) => request({
  url: '/admin/saveShop',
  method: 'post',
  data: shop
})
// 管理员修改用户
export const reqUpdateShop = (shop) => request({
  url: '/admin/updateShop',
  method: 'post',
  data: shop
})
// 管理员删除店铺
export const deleteShopById = (shop) => request({
  url: '/admin/deleteShopById',
  method: 'post',
  data: shop
})
